home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 February / EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso / enigma / earcd / emula / arosdv19.lha / AROS / config / i386-emul / enable.s < prev    next >
Text File  |  1996-10-24  |  3KB  |  122 lines

  1. #    (C) 1995-96 AROS - The Amiga Replacement OS
  2. #    $Id: enable.s,v 1.10 1996/10/24 15:51:11 aros Exp $
  3. #    $Log: enable.s,v $
  4. #    Revision 1.10  1996/10/24 15:51:11  aros
  5. #    Use the official AROS macros over the __AROS versions.
  6. #
  7. #    Revision 1.9  1996/10/23 08:04:25  aros
  8. #    Use generated offsets which makes porting much easier
  9. #
  10. #    Revision 1.8  1996/10/18 07:24:42    aros
  11. #    Just removed my test-code :-)
  12. #
  13. #    Revision 1.7  1996/10/18 01:12:52    aros
  14. #    Added small patch to tell FreeBSD to use _sigprocmask not sigprocmask.
  15. #
  16. #    Revision 1.6  1996/10/10 13:24:47    digulla
  17. #    Make timer work (Fleischer)
  18. #
  19. #    Revision 1.5  1996/09/11 16:54:26    digulla
  20. #    Always use __AROS_SLIB_ENTRY() to access shared external symbols, because
  21. #    some systems name an external symbol "x" as "_x" and others as "x".
  22. #    (The problem arises with assembler symbols which might differ)
  23. #
  24. #    Revision 1.4  1996/08/23 16:49:20    digulla
  25. #    With some systems, .align 16 aligns to 64K instead of 16bytes. Therefore
  26. #    I replaced it with .balign which does what we want.
  27. #
  28. #    Revision 1.3  1996/08/13 14:03:18    digulla
  29. #    Added standard headers
  30. #
  31. #    Revision 1.2  1996/08/01 17:41:25    digulla
  32. #    Added standard header for all files
  33. #
  34. #    Desc:
  35. #    Lang:
  36.  
  37. #*****************************************************************************
  38. #
  39. #   NAME
  40. #    AROS_LH0(void, Enable,
  41. #
  42. #   LOCATION
  43. #    struct ExecBase *, SysBase, 21, Exec)
  44. #
  45. #   FUNCTION
  46. #
  47. #   INPUTS
  48. #
  49. #   RESULT
  50. #
  51. #   NOTES
  52. #
  53. #   EXAMPLE
  54. #
  55. #   BUGS
  56. #
  57. #   SEE ALSO
  58. #
  59. #   INTERNALS
  60. #
  61. #   HISTORY
  62. #
  63. #******************************************************************************
  64. #if defined(__FreeBSD__)
  65. #define sigprocmask _sigprocmask
  66. #endif
  67.  
  68.     .include "machine.i"
  69.  
  70.     .text
  71.     .balign 16
  72.     .globl    _Exec_Enable
  73.     .type    _Exec_Enable,@function
  74. _Exec_Enable:
  75.     /* Preserve all registers */
  76.     pushl    %edx
  77.     pushl    %eax
  78.  
  79.     /* Get SysBase */
  80.     movl    12(%esp),%edx
  81.  
  82.     /* Decrement and test IDNestCnt */
  83.     decb    IDNestCnt(%edx)
  84.     jge    noswch
  85.     call    en
  86.  
  87.     /* Is there a delayed switch pending and are taskswitches allowed? */
  88.     cmpb    $0,AttnResched(%edx)
  89.     jge    noswch
  90.     cmpb    $0,TDNestCnt(%edx)
  91.     jge    noswch
  92.  
  93.     /* Clear delayed switch bit and do the delayed switch */
  94.     andb    $127,AttnResched(%edx)
  95.     leal    Switch(%edx),%eax
  96.     pushl    %edx
  97.     call    *%eax
  98.     addl    $4,%esp
  99.  
  100.     /* Restore registers and return */
  101. noswch: popl    %eax
  102.     popl    %edx
  103.     ret
  104.  
  105. .globl en
  106.     .type    en,@function
  107. en:
  108.     pushl %eax
  109.     pushl %ecx
  110.     pushl %edx
  111.     pushl $-1
  112.     pushl $0
  113.     leal 4(%esp),%eax
  114.     pushl %eax
  115.     pushl $1
  116.     call sigprocmask
  117.     addl $16,%esp
  118.     popl %edx
  119.     popl %ecx
  120.     popl %eax
  121.     ret
  122.